package com.heima.crm.common.utils;

import java.util.Random;

public class YsRandomCodeUtils {


    // 随机生成线索id的工具类

    private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    private static final String NUMBERS = "0123456789";

    public static String generateRandomString() {
        StringBuilder stringBuilder = new StringBuilder();

        Random random = new Random();

        // Generate first two uppercase letters
        for (int i = 0; i < 2; i++) {
            char randomChar = CHARACTERS.charAt(random.nextInt(CHARACTERS.length()));
            stringBuilder.append(randomChar);
        }

        // Generate six digits
        for (int i = 0; i < 6; i++) {
            char randomDigit = NUMBERS.charAt(random.nextInt(NUMBERS.length()));
            stringBuilder.append(randomDigit);
        }

        return stringBuilder.toString();
    }
}

